<?php

include('../functions/db.php');
include('../functions/common.php');

$action=mres(($_POST['action']));

if ($action=='update_user'){
    $username = mres(($_POST['username']));
    $ime = mres(($_POST['ime']));
    $datum_rodjenja = mres(($_POST['datum_rodjenja']));
    $grad = mres(( $_POST['grad']));
    $drzava = mres(($_POST['drzava']));
    $telefon_privatni = mres(($_POST['telefon_privatni']));
    $web = mres(($_POST['web']));
    $email = mres(($_POST['email']));

    updateNalogPersonal($username, $ime, $datum_rodjenja, $grad, $drzava, $telefon_privatni, $web, $email);
}

else if ($action=='update_studio'){
    $username = mres(($_POST['username']));
    $odgovor = mres(($_POST['studio']));
    $adresa_studija = mres(($_POST['adresa_studija']));
    $telefon_studio = mres(($_POST['telefon_studio']));
    $email_studio = mres(($_POST['email_studio']));
    $web_studio = mres(($_POST['web_studio']));
    

    updateNalogStudio($username, $odgovor, $adresa_studija, $telefon_studio, $email_studio, $web_studio);
}

else if ($action=='update_osebi'){
    $username = mres(($_POST['username']));
    $osebi = mres(($_POST['osebi']));
    
    updateNalogOsebi($username, $osebi);
}

?>
